package cn.zzuisa.news.service.impl;

import java.util.List;

import cn.zzuisa.news.entity.IprNewsInfo;
import cn.zzuisa.news.entity.IprNewsItem;
import cn.zzuisa.news.entity.IprNewsType;
import cn.zzuisa.news.entity.Page;
import cn.zzuisa.news.form.IprNewsInfoForm;
import cn.zzuisa.news.form.IprNewsItemForm;
import cn.zzuisa.news.form.NewsEditForm;
import cn.zzuisa.news.repository.IprNewsRepository;
import cn.zzuisa.news.repository.dao.IprNewsDAO;
import cn.zzuisa.news.service.IprNewsService;

public class IprNewsServiceImpl implements IprNewsService{

	private IprNewsRepository iprNewsDAO = new IprNewsDAO();
	@Override
	public boolean addType(String name) {
		// TODO Auto-generated method stub
		return iprNewsDAO.addType(name);
	}

	@Override
	public boolean addNewsInfo(IprNewsInfoForm iprNewsInfoForm) {
		// TODO Auto-generated method stub
		return iprNewsDAO.addNewsInfo(iprNewsInfoForm);
	}

	@Override
	public List<IprNewsType> listtype() {
		// TODO Auto-generated method stub
		return iprNewsDAO.listtype();
	}

	@Override
	public IprNewsType findIprNewsTypeById(Integer id) {
		// TODO Auto-generated method stub
		return iprNewsDAO.findIprNewsTypeById(id);
	}

	@Override
	public List<IprNewsInfo> listinfoByType(Integer type) {
		// TODO Auto-generated method stub
		return iprNewsDAO.listinfoByType(type);
	}

	@Override
	public IprNewsInfo findInfoById(Integer id) {
		// TODO Auto-generated method stub
		return iprNewsDAO.findInfoById(id);
	}

	@Override
	public boolean editByFormAndId(IprNewsInfoForm iprNewsInfoForm, Integer id) {
		// TODO Auto-generated method stub
		return iprNewsDAO.editById(iprNewsInfoForm, id);
	}

	@Override
	public boolean delete(Integer id) {
		// TODO Auto-generated method stub
		return iprNewsDAO.delete(id);
	}

	@Override
	public boolean addNewsItem(IprNewsItemForm iprNewsItemForm) {
		// TODO Auto-generated method stub
		return iprNewsDAO.addNewsItem(iprNewsItemForm);
	}

	@Override
	public List<String> showTypes() {
		// TODO Auto-generated method stub
		return iprNewsDAO.showTypes();
	}

	@Override
	public List<String> showTypesId() {
		// TODO Auto-generated method stub
		return iprNewsDAO.showTypesId();
	}

	@Override
	public Page page(Integer current, Integer size, String sql) {
		// TODO Auto-generated method stub
		return iprNewsDAO.page(current, size, sql);
	}

	@Override
	public IprNewsItem findById(Integer id) {
		// TODO Auto-generated method stub
		return iprNewsDAO.findById(id);
	}

	@Override
	public boolean edit(NewsEditForm newsEditForm) {
		// TODO Auto-generated method stub
		return iprNewsDAO.edit(newsEditForm);
	}

	@Override
	public boolean deleteNewsItem(Integer id) {
		// TODO Auto-generated method stub
		return iprNewsDAO.deleteNewsItem(id);
	}

}
